﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第三十七题
//BC39 争夺前五名
//https://www.nowcoder.com/practice/cd052308a1c44a88ad00255f312c3e14?tpId=107&tqId=33320&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

//思路：利用数组存储数据，然后进行排序。
int main() {
    int n = 0;
    scanf("%d", &n);
    int score[50] = { 0 };

    for (int i = 0; i < n; i++) {
        scanf("%d", &score[i]);
    }

    for (int i = 0; i < n; i++) {
        for (int j = i; j < n; j++) {
            if (score[i] < score[j]) {
                int tmp = 0;
                tmp = score[i];
                score[i] = score[j];
                score[j] = tmp;
            }
        }
    }

    for (int i = 0; i < 5; i++) {
        printf("%d ", score[i]);
    }
    return 0;
}